class uvm_root extends uvm_component;
	static local uvm_root m_inst;

	extern protected function new();

	extern static function uvm_root get();

	static function uvm_root m_uvm_get_root(); // 被核心服务类调用的内部方法
		if (m_inst == null) begin
			m_inst = new();
			$display("%s(%0d) create a unique object of singleton class uvm_root using m_uvm_get_root method", `__FILE__, `__LINE__);
		end
		return m_inst;
	endfunction

	extern virtual task run_test(string test_name=""); // 创建测试对象
endclass

const uvm_root uvm_top = uvm_root::get(); // 全局常量对象句柄

function uvm_root uvm_root::get();
	uvm_coreservice_t cs = uvm_coreservice_t::get();
	return cs.get_root();
endfunction

function uvm_root::new();
	super.new("__top__", null);
endfunction

task uvm_root::run_test(string test_name=""); // 创建测试对象
	uvm_component uvm_test_top;
	$display("%s(%0d) running test %s ...", `__FILE__, `__LINE__, test_name);
endtask
